package com.buaa.wangrui.client.client;

import com.buaa.wangrui.client.interfaces.ObjectFactory;
import com.buaa.wangrui.client.interfaces.ObjectFactoryListener;
import com.buaa.wangrui.client.panel.LoadingPanel;
import com.buaa.wangrui.client.panel.RoundedPanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.TreeListener;

public class DatabaseEditorView extends Composite implements TreeListener,ObjectFactoryListener{
	
	//部件
	private HorizontalPanel mainPanel = new HorizontalPanel();
	private Tree treeList = new Tree();
	private LoadingPanel loading = new LoadingPanel();
	private TreeItem  userItems = new TreeItem(this);
	private TreeItem storyItem = new TreeItem(this);
	
	private ObjectFactory objectFactory;
	
	public DatabaseEditorView(){
		initWidget(mainPanel);
		setStyleName("DatabaseEditorView");
        RoundedPanel rounded  = new RoundedPanel("#f0f4f8");
        rounded.setWidget(treeList);
        rounded.setWidth("100%");
        mainPanel.add(rounded);
        treeList.addItem(storyItem);
        treeList.addItem(userItems);
        treeList.addTreeListener(this);
        RootPanel.get().add(loading);

		
	}

	public void onTreeItemSelected(TreeItem item) {
		// TODO Auto-generated method stub
		
	}

	public void onTreeItemStateChanged(TreeItem item) {
		// TODO Auto-generated method stub
		
	}

	public void onError() {
		// TODO Auto-generated method stub
		
	}

	public void onLoadingStar() {
		// TODO Auto-generated method stub
		
	}

	public void onRefresh() {
		// TODO Auto-generated method stub
		
	}

	public void onloadingfinish() {
		// TODO Auto-generated method stub
		
	}

	
}
